import request from '@/utils/request'

export function fetchPermissionList() {
  return request({
    url: '/sys/permission',
    method: 'GET'
  })
}

export function addPermission(data) {
  return request({
    url: '/sys/permission',
    method: 'POST',
    data
  })
}

export function updatePermission(data) {
  return request({
    url: `/sys/permission/${data.id}`,
    method: 'PUT',
    data
  })
}

export function fetchPermissionDetail(id) {
  return request({
    url: `/sys/permission/${id}`,
    method: 'GET'
  })
}
